﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SMTC.BO.DataServer;
using SMTC.WebCommon.Common;

public partial class DataServer_ServerManger : BasePage
{
    private DataServerServices services = new DataServerServices();
    protected void Page_Load(object sender, EventArgs e)
    {
    }

    protected void btnUpd_Click(object sender, EventArgs e)
    {
        if (services.AddServer(txtM_IP.Text.Trim(),txtM_UserName.Text.Trim(),txtM_PassWord.Text.Trim()) == true)
        {
            ShowMessage("Add Success");
        }
        else
        {
            ShowMessage("Add Fail");
        }
        gvDataServer.DataBind();
    }
    protected void gvDataServer_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        if (e.CommandName == "Del")
        {
            if (services.DelServer(e.CommandArgument.ToString()) == true)
            {
                ShowMessage("Delete Success");
            }
            else
            {
                ShowMessage("Delete Fail");
            }
            gvDataServer.DataBind();
        }
    }
}